package cn.wolfcode.trip.base.service.impl;

import cn.wolfcode.trip.base.domain.DailyCollect;
import cn.wolfcode.trip.base.mapper.DailyCollectMapper;
import cn.wolfcode.trip.base.service.IDailyCollectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class DailyCollectServiceImpl implements IDailyCollectService {
   @Autowired
    private DailyCollectMapper dailyCollectMapper;

    @Override
    public DailyCollect get(Long userId, Long dailyId) {
        return dailyCollectMapper.selectByUserIdAndDailyId(userId,dailyId);
    }

    @Override
    public void delete(Integer id) {
        dailyCollectMapper.deleteByPrimaryKey(id);
    }

    @Override
    public void save(DailyCollect dailyCollect) {
        dailyCollectMapper.insert(dailyCollect);
    }

    @Override
    public int selectCount(Long dailyId) {
        return dailyCollectMapper.selectCount(dailyId);
    }


}
